﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;

namespace Minimalized
{
    class GameObject
    {
        //Fields
        //----------------
        private Rectangle _rect;
        private Texture2D _texture;
        private int _sizeX;
        private int _sizeY;
        private Vector2 _position;
        private Vector2 _velocity;
        //----------------
        /// <summary>
        /// Constructor for object with size, position, velocity and texture
        /// </summary>
        /// <param name="size"></param>
        /// <param name="position"></param>
        /// <param name="speed"></param>
        /// <param name="texture"></param>
        public GameObject(Point size, Vector2 position, Vector2 velocity, Texture2D texture)
        {
            _sizeX = size.X;
            _sizeY = size.Y;
            _position = position;
            _velocity = velocity;
            _texture = texture;
            rectangle = new Rectangle((int)position.X, (int)position.Y, size.X, size.Y);
        }
        /// <summary>
        /// Standard constructor
        /// </summary>
        public GameObject()
        { 
            
        }
        /// <summary>
        /// ****
        /// </summary>
        /// <param name="gameTime"></param>
        public virtual void Update(GameTime gameTime)
        { 
            
        }
        /// <summary>
        /// ****
        /// </summary>
        /// <param name="spriteBatch"></param>
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_texture, _rect, Color.White);
        }
        
        #region Properties
        /// <summary>
        /// Property for rectangle
        /// </summary>
        public Rectangle rectangle
        {
            get { return _rect; }
            set
            { _rect = value; }
        }
        /// <summary>
        /// Property for texture
        /// </summary>
        public Texture2D texture
        {
            get {return _texture ;}
            set { _texture = value; }
        }

        /// <summary>
        /// Propery for position
        /// </summary>
        public Vector2 position 
        {
            get {return _position ;}
            set { _position = value ;}
        }

        /// <summary>
        /// Property for velocity
        /// </summary>
        public Vector2 velocity
        {
            get {return _velocity ;}
            set { _velocity = value; }
        }
        #endregion
    }
}
